#include "AttackObject.h"
#include "WorldHandler.h"
#include <assert.h>
#include <iostream>

AttackObject::AttackObject()
{
	setObjectType(ATTACK_OBJECT);
	
	particleSystem = NULL;
}

AttackObject::~AttackObject()
{

}

#if 0
void AttackObject::setParticleSystem(scene::IParticleSystemSceneNode* passedSystem)
{
    particleSystem = passedSystem;
}

scene::IParticleSystemSceneNode* AttackObject::getParticleSystem()
{
    return particleSystem;
}
#endif
void AttackObject::setAttackType(AttackType type)
{
	attackType = type;
	switch(type)
	{
		case MELEE:
			setSpeedConstant(130.f);
			range = 20;
		break;
		case FIREBALL:
			setSpeedConstant(400.f);
			range = 100;
		break;
		case FROSTBALL:
			setSpeedConstant(130.f);
			range = 100;
		break;
		default:
			std::cout << "CASE " << type << " not handled in setAttackType\n";
			assert(1 == 0);
		break;
	}
}

AttackType AttackObject::getAttackType()
{
	return attackType;
}

void AttackObject::setupParticleSystem()
{
	particleSystem = globalWorldHandler.createParticleSystem(attackType, getNode());
}

void AttackObject::setOriginatingPlayer(const std::string& name)
{
	originatingPlayer = name;
}

const std::string& AttackObject::getOriginatingPlayer()
{
	return originatingPlayer;
}

unsigned int AttackObject::getRange()
{
	return range;
}

void AttackObject::setRange(unsigned int passedRange)
{
	range = passedRange;
}
